import Cookies from "js-cookie";
const key = "E_token";
export function getSessionItem() {
  // let val = sessionStorage.getItem(key);
  // try {
  //   //如果是number boolean jsonstring是不会报错的
  //   return JSON.parse(val);
  // } catch (e) {
  //   return val;
  // }
  return Cookies.get(key);
}

export function setSessionItem(val) {
  // return sessionStorage.setItem(key, JSON.stringify(val));
  return Cookies.set(key, val, { expires: 1 });
}

export function removeSessionItem() {
  // return sessionStorage.removeItem(key);
  return Cookies.remove(key)
}
